package gui;

import javax.swing.JPanel;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JScrollPane;
import javax.swing.JComboBox;
import javax.swing.JTextArea;
import javax.swing.BoxLayout;

public class AppPanelScene extends JPanel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3532086094480804100L;
	public static JButton btnSceneNrDown = new JButton("Down");
	public static JLabel lblSceneActNr = new JLabel("Move");
	public static JButton btnSceneNrUp = new JButton("Up");
	public static JButton btnSceneCreate = new JButton("Create");
	public static JButton btnSceneDelete = new JButton("Delete");
	public static JButton btnSceneEdit = new JButton("Save");
	public static JTextField txtSceneName = new JTextField();
	public static JScrollPane scrollPane = new JScrollPane();
	public static JScrollPane scrollSceneAvailableChars = new JScrollPane();
	public static JScrollPane scrollSceneSelectedChars = new JScrollPane();
	public static JPanel panel = new JPanel();
	public static JButton btnSceneAddChar = new JButton(">");
	public static JButton btnSceneAddAllChars = new JButton(">>");
	public static JButton btnSceneRemoveAllChars = new JButton("<<");
	public static JButton btnSceneRemoveChar = new JButton("<");
	public static JLabel lblSceneAvailableCharacters = new JLabel("Available Characters");
	public static JLabel lblSceneSelectedCharacters = new JLabel("Selected Characters");
	public static JLabel lblSceneDate = new JLabel("Date");
	public static JLabel lblSceneDuration = new JLabel("Duration");
	public static JLabel lblSceneLocation = new JLabel("Location");
	public static JLabel lblScenePlot = new JLabel("Plot");
	public static JTextField txtSceneDuration = new JTextField();
	public static JComboBox dropSceneLocation = new JComboBox();
	public static JComboBox dropScenePlot = new JComboBox();
	public static JTextField txtSceneFile = new JTextField();
	public static JButton btnSceneFile = new JButton("Create File");
	public static JTextArea taSceneDesc = new JTextArea();
	public static JComboBox dropSceneStatus = new JComboBox();
	public static JLabel lblSceneStatus = new JLabel("Status");
	public static JLabel labelSceneChapter = new JLabel("Chapter");
	public static JComboBox dropSceneChapter = new JComboBox();
	private final JPanel panelDate = new JPanel();
	public static JTextField txtSceneMonth = new JTextField();
	public static JTextField txtSceneYear = new JTextField();
	public static JTextField txtSceneDay = new JTextField();
	private final JLabel lblSceneName = new JLabel("Scene Name");
	
	
	
	/**
	 * Create the panel.
	 */
	public AppPanelScene() {
		txtSceneDay.setText("DD");
		txtSceneDay.setColumns(10);
		txtSceneYear.setText("YY");
		txtSceneYear.setColumns(10);
		txtSceneMonth.setText("MM");
		txtSceneMonth.setColumns(10);
		txtSceneFile.setColumns(10);
		txtSceneDuration.setColumns(10);
		txtSceneName.setText("the name of your chapter");
		txtSceneName.setColumns(10);
		setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("75px"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("150px:grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("150px:grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("max(75px;default)"),
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		add(lblSceneName, "4, 2, 3, 1");
		add(btnSceneEdit, "2, 4");
		txtSceneName.setText("\"the name of your chapter\"");
		add(txtSceneName, "4, 4, 3, 1, fill, default");
		txtSceneName.setColumns(10);
		add(txtSceneName, "4, 4, 3, 1, fill, default");
		add(btnSceneDelete, "2, 6");
		
		add(scrollPane, "4, 6, 3, 5, fill, fill");
		taSceneDesc.setWrapStyleWord(true);
		taSceneDesc.setLineWrap(true);
		
		scrollPane.setViewportView(taSceneDesc);
		
		add(btnSceneCreate, "2, 8");
		
		JPanel panelNr = new JPanel();
		add(panelNr, "2, 10, 1, 17, fill, fill");
		panelNr.setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		panelNr.add(btnSceneNrUp, "2, 4");
		panelNr.add(lblSceneActNr, "2, 6, center, default");
		panelNr.add(btnSceneNrDown, "2, 8");
		panelNr.add(labelSceneChapter, "2, 12, center, default");
		panelNr.add(dropSceneChapter, "2, 14");
		
		add(lblSceneAvailableCharacters, "4, 12");
		
		add(lblSceneSelectedCharacters, "6, 12");
		
		add(scrollSceneAvailableChars, "4, 14, fill, fill");
		
		add(scrollSceneSelectedChars, "6, 14, fill, fill");
		
		add(panel, "4, 16, 3, 1, fill, fill");
		
		panel.add(btnSceneRemoveChar);
		
		panel.add(btnSceneRemoveAllChars);
		
		panel.add(btnSceneAddAllChars);
		
		panel.add(btnSceneAddChar);
		
		add(lblSceneDate, "4, 18");
		
		add(lblSceneDuration, "6, 18");
		
		add(txtSceneDuration, "6, 20, fill, default");
		
		add(panelDate, "4, 20, fill, fill");
		panelDate.setLayout(new BoxLayout(panelDate, BoxLayout.X_AXIS));
		
		panelDate.add(txtSceneMonth);
		
		panelDate.add(txtSceneDay);
		
		panelDate.add(txtSceneYear);
		
		add(lblSceneLocation, "4, 22");
		
		add(lblScenePlot, "6, 22");
		
		add(dropSceneLocation, "4, 24, fill, default");
		
		add(dropScenePlot, "6, 24, fill, default");
		
		add(txtSceneFile, "4, 26, fill, default");
		
		add(btnSceneFile, "6, 26");
		
		add(lblSceneStatus, "6, 28, left, default");
		
		add(dropSceneStatus, "6, 30, fill, default");
	}

}
